<?php
$section = 'gallery';

$titre = _LB_GALLERY_MANAGEMENT;
$smarty->assign("titre", $titre);

$id = Request::getIntNumber('id');
$backlink = Session::getBackLink($section,"list/?");
Session::setBackLink($section);
$album = new Album();
if(!$id || !$album->get($id))
{
    redirect($backlink);		
}
$album_gallery = new Album_Gallery();
$query = "SELECT * FROM ALBUM_GALLERY WHERE ID_ALBUM = {$id} ORDER BY ID DESC";
$args = array();
$pager = new  DBPager($album_gallery,$args, false ,PAGING_DEFAULT_ITEM_PER_PAGE,$query);
$album_gallery->query($query);
$cfer = new Cfer(array(
	_LB_ACCUEIL => Utils::getHomeLink(),
    _LB_GALLERY_MANAGEMENT => APPLICATION_URL."/gallery/list",
	_LB_GALLERY_ALBUM_DETAIL => Utils::getCurrentLink()));
$smarty->assign('cfer', $cfer);
$smarty->assign('album', $album);
$smarty->assign('album_gallery', $album_gallery);
$smarty->assign('pager', $pager);
$smarty->display('gallery_album_detail.html');